/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * testIGrame.java
 *
 * Created on May 27, 2011, 3:28:16 PM
 */

package jgaf.procedure;

import java.awt.event.KeyEvent;
import jgaf.editor.Editor;

/**
 *
 * @author hanis
 */
public class testIGrame extends javax.swing.JInternalFrame {

    Editor editor;

    /** Creates new form testIGrame */
    public testIGrame() {
        initComponents();

    }

    public testIGrame(Editor editor) {
        super(editor.getName(), true, true, true, true);
        initComponents();
        this.editor = editor;
        setMaximizable(true);
        setClosable(true);
        setResizable(true);

    }


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameActivated(evt);
            }
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameClosed(evt);
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameClosing(evt);
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameDeactivated(evt);
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameDeiconified(evt);
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameIconified(evt);
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameOpened(evt);
            }
        });
        addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                formFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                formFocusLost(evt);
            }
        });
        addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                formKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 394, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 274, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_formFocusGained
        System.out.println(editor.getId() + ":" + editor.getName() + " - focus gained");
    }//GEN-LAST:event_formFocusGained

    private void formFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_formFocusLost
        System.out.println(editor.getId() + ":" + editor.getName() + " - focus lost");
    }//GEN-LAST:event_formFocusLost

    private void formInternalFrameActivated(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameActivated
        System.out.println(editor.getId() + ":" + editor.getName() + " - activated");
    }//GEN-LAST:event_formInternalFrameActivated

    private void formInternalFrameClosed(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameClosed
        System.out.println(editor.getId() + ":" + editor.getName() + " - closed");
    }//GEN-LAST:event_formInternalFrameClosed

    private void formInternalFrameClosing(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameClosing
        System.out.println(editor.getId() + ":" + editor.getName() + " - closing");
    }//GEN-LAST:event_formInternalFrameClosing

    private void formInternalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameDeactivated
        System.out.println(editor.getId() + ":" + editor.getName() + " - deactivated");
    }//GEN-LAST:event_formInternalFrameDeactivated

    private void formInternalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameDeiconified
        System.out.println(editor.getId() + ":" + editor.getName() + " - deiconified");
    }//GEN-LAST:event_formInternalFrameDeiconified

    private void formInternalFrameIconified(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameIconified
        System.out.println(editor.getId() + ":" + editor.getName() + " - iconified");
    }//GEN-LAST:event_formInternalFrameIconified

    private void formInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameOpened
        System.out.println(editor.getId() + ":" + editor.getName() + " - opened");
    }//GEN-LAST:event_formInternalFrameOpened

    private void formKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_formKeyPressed
        System.out.println(editor.getId() + ":" + editor.getName() + " - key pressed");
        if(evt.isControlDown() && evt.getKeyCode() == KeyEvent.VK_TAB) {
            System.out.println("Ctrl + TAB pressed");
        }
    }//GEN-LAST:event_formKeyPressed



    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
